package P1400;

import java.util.ArrayList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-10-08 14:24
 */
public class P1428_小鱼比可爱 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int nums = scanner.nextInt();
        PriorityQueue<Integer> heap = new PriorityQueue<>((o1,o2)->o2-o1);
        StringBuilder sb = new StringBuilder();
        while(nums-- > 0){
            int now = 0;
            int val = scanner.nextInt();
            List<Integer> temp = new ArrayList<>();
            while(!heap.isEmpty() && heap.peek() >= val){
                temp.add(heap.poll());
            }
            sb.append(heap.size()).append(' ');
            heap.offer(val);
            heap.addAll(temp);
        }
        scanner.close();
        sb.deleteCharAt(sb.length()-1);
        System.out.println(sb.toString());
    }
}
